{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1c8f17b7-dc42-408f-9b21-cdcfd7dbfb78",
   "metadata": {},
   "source": [
    "# AutoTrader Code Generator\n",
    "\n",
    "Gemini-driven autonomous equities trading bot code generator for simulated market APIs"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcffcfd7-000f-4995-82ae-94232fef1654",
   "metadata": {},
   "source": [
    "## Imports"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "43d8c659-08d4-4a65-8c39-e42f6c458ba8",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install -U -q \"google-genai\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "de542411-6b4d-47cd-bf84-d80562b333a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import io\n",
    "import sys\n",
    "from dotenv import load_dotenv\n",
    "from google import genai\n",
    "from google.genai import types\n",
    "from IPython.display import Markdown, display, update_display\n",
    "import gradio as gr\n",
    "import subprocess"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9b78b19-2d47-4973-adbc-d281d8ac8224",
   "metadata": {},
   "source": [
    "## Google API Key Setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9a2e07f-9b07-4afe-8938-ba40c41701ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "load_dotenv(override=True)\n",
    "google_api_key = os.getenv('GOOGLE_API_KEY')\n",
    "\n",
    "if google_api_key:\n",
    "    print(f\"Google API Key exists and begins with: {google_api_key[:4]}\")\n",
    "else:\n",
    "    print(\"Google API Key not set\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4da3664d-9d73-41a2-8a71-fe9468f3955f",
   "metadata": {},
   "outputs": [],
   "source": [
    "!python ./gemini_trading_code_generator.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f7b7c74-3d77-49d3-ac9f-f3a04743946c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
